import Route from 'react-router/lib/Route';

import Home from './components/Home';
import VotingList from './components/VotingList';
import MyVoting from './components/MyVoting';
import PrintPreview from './components/result/PrintPreview';

import { WeaLocaleProvider } from 'ecCom';
import './style/index';

const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'voting');
const VotingRoute = (
  <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@e9a7eh`} name="voting" breadcrumbName="调查" path="voting" onEnter={getLocaleLabel} component={Home}>
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@40iwmx`} name="votingList" breadcrumbName="调查结果" path="votingList" component={VotingList} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@jypdxx`} name="myVoting" breadcrumbName="参与调查" path="myVoting" component={MyVoting} />
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@m9pjw6`} name="preview" breadcrumbName="附件预览" path="preview" component={PrintPreview} />
  </Route>
);

import store from './stores/index';

// const { myWorkPlanStore } = store;
// import { Provider } from 'mobx-react';
// class WorkPlanCreateProvider extends React.Component {
//     render(){
//         const { isCustom=false } = this.props;
//         if(isCustom) return <Provider myWorkPlanStore={store.myWorkPlanStore}><WorkPlanCreate {...this.props}/></Provider>
//         return <WorkPlanCreate {...this.props}/>
//     }
// }

// console.log('store',store)
module.exports = {
  Route: VotingRoute,
  stores: store,
};
